home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / encorsrc.lha / encore_sources / sys / dump_comex.t < prev    next >
Text File  |  1988-05-02  |  1KB  |  31 lines

  1. (herald dump_comex
  2.         (env tsys (osys table) (osys inf_vector) (osys dump)))
  3.  
  4. ;;; This file is seperate because dump is not included in the VM;
  5. ;;; whereas, load is.
  6.  
  7. (define (comex-encoder obj)
  8.   (if (comex? obj)
  9.       (return 'comex '() (stype-selectors comex-stype))
  10.       (return nil nil nil)))
  11.  
  12. ;++ flush this
  13. (define (write-comex-to-file spec comex)
  14.   (with-open-ports ((port (open spec 'dump)))
  15.     (set-encoder port comex-encoder)
  16.     (write port comex)))
  17.  
  18. (define (write-comex port comex)
  19.   (let ((things    (make-infinite-vector 60 false 'dump-vector))
  20.         (status    (make-dump-status))
  21.         (delimits  '())
  22.         (encoder   (lambda (x) (ignore x) (return nil nil nil)))
  23.         (objects   (make-table 'dumped-objects)))
  24.      (set-encoder port comex-encoder)
  25.      (push delimits (dump-status-count status))
  26.      (vectorize comex things status objects encoder)
  27.      (dump-port port things status objects (reverse! (cons -1 delimits)))
  28.      (recycle things)
  29.      (recycle objects)
  30.      (no-value)))
  31.